<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="authority/common/currency/head"></div>
    <link rel="stylesheet" th:href="@{/authority/css/form-auto.css}">
    <style>
        body {
            background-color: #F2F2F2;
        }
        .zsa-tab-title {
            top: 0;
            padding-top: 20px;
            width: 100%;
            position: fixed;
            z-index: 9999;
            background-color: #F2F2F2;
        }

        .zsa-tab-content {
            padding: 60px 0 20px 0;
        }
    </style>
</head>

<body class="childrenBody" padding10>
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title zsa-tab-title">
        <li><a href="javascript:location.href = content_path + 'swagger-ui.html';">接口api</a></li>
        <li class="layui-this">数据库DML相关属性</li>
        <li><a th:href="@{/authority/api/search/help.html}">查询/排序</a></li>
        <!--<li class=""><a th:href="@{/business/pack_list.html}"></a></li>-->
    </ul>
    <div class="layui-form layui-tab-content zsa-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="layui-card">
                <div class="layui-card-header">DML_COLUMN 表 ATTRS 属性</div>
                <div class="layui-card-body">
                    <form class="layui-form" action="" onsubmit="return false;" lay-filter="from-dml-column-attrs">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">输入属性值</label>
                                <div class="layui-input-block">
                                    <input type="text" name="value" required lay-verify="required" placeholder="属性值"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-block">
                                    <button class="layui-btn layui-btn-sm" lay-submit lay-filter="submit">导入</button>
                                    <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">对应的值</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" name="like[1]" lay-filter="checkbox" value="1" title="主键">
                                    <input type="checkbox" name="like[2]" lay-filter="checkbox" value="2" title="不能为空">
                                    <input type="checkbox" name="like[4]" lay-filter="checkbox" value="4"
                                           title="insert字段">
                                    <input type="checkbox" name="like[8]" lay-filter="checkbox" value="8"
                                           title="update字段">
                                    <input type="checkbox" name="like[16]" lay-filter="checkbox" value="16" title="只读">
                                    <input type="checkbox" name="like[32]" lay-filter="checkbox" value="32" title="可查询">
                                    <input type="checkbox" name="like[64]" lay-filter="checkbox" value="64" title="可排序">
                                    <input type="checkbox" name="like[128]" lay-filter="checkbox" value="128"
                                           title="可用于分组">
                                    <input type="checkbox" name="like[256]" lay-filter="checkbox" value="256"
                                           title="用于筛选">
                                    <input type="checkbox" name="like[512]" lay-filter="checkbox" value="512"
                                           title="用于显示">
                                    <input type="checkbox" name="like[1024]" lay-filter="checkbox" value="1024"
                                           title="特殊处理CODE">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">最终结果</label>
                            <div class="layui-input-block">
                                <input type="text" name="result" required placeholder="最终结果"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </form>
                </div>
            </div>


            <div class="layui-card">
                <div class="layui-card-header">DML_COLUMN 表 COLUMN_TYPE 属性</div>
                <div class="layui-card-body">
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>0</b> &nbsp;&nbsp; SELECT_COLUMN</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>1</b> &nbsp;&nbsp; IN_PARAM_COLUMN</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>2</b> &nbsp;&nbsp; OUT_PARAM_COLUMN</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>3</b> &nbsp;&nbsp; INOUT_PARAM_COLUMN</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>4</b> &nbsp;&nbsp; RET_VALUE_COLUMN</blockquote>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">DML 表 DML_TYPE 属性</div>
                <div class="layui-card-body">
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>-1</b> &nbsp;&nbsp;  anyWhere查询语句,必须定义列</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>0</b> &nbsp;&nbsp; 静态查询语句,使用raw_dml来执行查询</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>1</b> &nbsp;&nbsp; 动态查询语句，必须定义列</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>2</b> &nbsp;&nbsp; 插入语句</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>3</b> &nbsp;&nbsp; 更新语句</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>4</b> &nbsp;&nbsp; 删除语句</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>5</b> &nbsp;&nbsp; 语句块</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>6</b> &nbsp;&nbsp; 过程</blockquote>
                    <blockquote class="layui-elem-quote layui-quote-nm"><b>7</b> &nbsp;&nbsp; 函数</blockquote>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:replace="authority/common/currency/footer"></div>
<script type="text/javascript">
    layui.use(['form', 'lutil'], function () {
        var form = layui.form,
            lutil = layui.lutil,
            layer = layui.layer;

        form.on('checkbox(checkbox)', function (data) {
            var p_value = 0;
            var checkBoxs = $(data.elem).closest(".layui-input-block").children("input[type=checkbox]");
            $.each(checkBoxs, function (i, e) {
                if (e.checked) p_value += parseFloat(e.value);
            });
            $(data.elem).closest('form').find('input[name=result]').val(p_value === 0 ? '' : p_value);
        });
        form.on('submit(submit)', function (data) {
            var iValue = parseFloat(data.field['value']);
            $(data.form).find('input[type=checkbox]').each(function (i, e) {
                var dValue = parseFloat(e.value);
                e.checked = ((iValue & dValue) === dValue);
            });
            form.render('checkbox', $(data.form).attr('lay-filter'));
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });

    })

</script>

</body>
</html>